package com.gyms.fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import com.classic.okhttp.beans.HVProjectInfoBean;
import com.classic.okhttp.beans.HVVenueWeekTimesBean;
import com.gyms.R;
import com.gyms.activity.GymDetailActivity;
import com.gyms.adapter.OrderGymAdapter;
import com.gyms.base.BaseFragment;
import com.gyms.constant.Constants;

import java.util.ArrayList;

import butterknife.BindView;
import weight.FullyLinearLayoutManager;

/**
 * ltx on 2016/11/15 14:11
 * 预定的fragment
 */
public class OrderFragment extends BaseFragment {
    @BindView(R.id.rv_gym_order)
    RecyclerView mRvGymOrder;
    private String mProjectid;
    private String mProjectName;
    public ArrayList<HVVenueWeekTimesBean> scene;


    public OrderFragment() {
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.order_fragment;
    }

    @Override
    protected void initView() {
        HVProjectInfoBean hvProjectInfoBean = (HVProjectInfoBean) getArguments().getSerializable(Constants.FLAG_INTENT_PROJECT);
        String venueId = ((GymDetailActivity) getActivity()).venueId;
        if(null!=hvProjectInfoBean){
            mProjectid= hvProjectInfoBean.getProjectid();
            mProjectName= hvProjectInfoBean.getProjectName();//场馆名称
            scene=hvProjectInfoBean.getScene();
        }
        LinearLayoutManager linearLayoutManager = new FullyLinearLayoutManager(mContext);
        linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
        mRvGymOrder.setLayoutManager(linearLayoutManager);
        OrderGymAdapter mAdapter = new OrderGymAdapter(mContext, venueId,mProjectid,mProjectName);
        mAdapter.setHVVenueWeekTimesBeans(scene);
      mRvGymOrder.setAdapter(mAdapter); //设置适配器*/

    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void processLogic() {

    }
}
